cmd/read.c: Fix checking blk_dread return value
authorTom Rini <[email protected]>
Tue, 15 Aug 2017 00:58:50 +0000 (20:58 -0400)
committerTom Rini <[email protected]>
Sun, 20 Aug 2017 13:54:30 +0000 (09:54 -0400)
commitd03618d5cbc3e1fb4f8c63f2e4966f825007ce08
treefe40556e424d977d1985ffaece87f15bc6e05a81
parent54f1792c8df1dba9cd41d811a7860ddd417f634e
cmd/read.c: Fix checking blk_dread return value

The function blk_dread will return -ENOSYS on failure or on success the
number of blocks read, which must be the number asked to read (otherwise
it failed somewhere).  Correct this check.

Reported-by: Coverity (CID: 166335)
Cc: Philipp Tomsich <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Bin Meng <[email protected]>
Signed-off-by: Tom Rini <[email protected]>
cmd/read.c